"use client"
import dynamic from 'next/dynamic';
import { useParams } from 'next/navigation';
import { Suspense } from 'react';
// import EditorDefinitionPanelView from "@/components/EditPanel";

const EditorDefinitionView = () => {
    // 使用 dynamic 导入，并禁用 SSR
    const EditorDefinitionPanelView = dynamic(
        () => import('@/components/EditPanel'),
        {
            ssr: false,
            loading: () => <div>加载编辑器...</div>,
        }
    );
    const { id } = useParams(); // 获取动态参数
    return (
        <>
            <Suspense fallback={<div>加载中...</div>}>
                <EditorDefinitionPanelView  id={id!=='add'?id:null}/>
            </Suspense>
        </>);
};

export default EditorDefinitionView;
